package com.iplant.ams.service.po.dms.maintenance;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;

/**
 * 设备构型BOM
 *
 * @author YouWang·Peng
 * 2022-8-8 09:20:21
 */
@DBBasePO(TableName = "dms_device_bom", Schemas = DBSchemas.AMS, CheckName = {"Code",
        "DeviceID,ConfigurationID,MaterialID"}, CodePrefix = "DBOM-", CodeAuto = true)
public class DMSDeviceBOM extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 设备ID
     */
    @DBField
    @DBCondition
    public int DeviceID = 0;
    @DBJoin(name = "AssetInfoID", tableName = "dms_device_ledger", tableAsName = "dms_device_ledger1", Schemas =
            DBSchemas.AMS,
            MainTableField = "DeviceID")
    public int AssetInfoID = 0;

    /**
     * 设备名称
     **/
    @DBJoin(name = "Name", tableName = "ams_asset_list", tableAsName = "ams_asset_list1", Schemas = DBSchemas.AMS,
            JoinIndex = 2,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=ams_asset_list1.ID")
    public String DeviceName = "";
    /**
     * 设备编码
     **/
    @DBJoin(name = "Code", tableName = "ams_asset_list", tableAsName = "ams_asset_list1", Schemas = DBSchemas.AMS,
            JoinIndex = 2,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=ams_asset_list1.ID")
    public String DeviceCode = "";

    /**
     * 构型ID
     */
    @DBField
    @DBCondition
    public int ConfigurationID = 0;
    @DBJoin(name = "Name", tableName = "dms_configuration", tableAsName = "dms_configuration1", Schemas = DBSchemas.AMS,
            MainTableField = "ConfigurationID")
    public String ConfigurationName = "";
    @DBJoin(name = "Code", tableName = "dms_configuration", tableAsName = "dms_configuration1", Schemas = DBSchemas.AMS,
            MainTableField = "ConfigurationID")
    public String ConfigurationCode = "";

    /**
     * 物料ID
     */
    @DBCondition
    @DBField
    public int MaterialID = 0;
    /**
     * 物料编码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "mss_material", tableAsName = "mss_material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public String MaterialNo = "";
    /**
     * 物料名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "MaterialName", tableName = "mss_material", tableAsName = "mss_material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public String MaterialName = "";

    /**
     * 数量
     */
    @DBField
    public double Number = 0.0;

    @JsonProperty("DeviceID")
    public int getDeviceID() {
        return DeviceID;
    }

    public void setDeviceID(int deviceID) {
        DeviceID = deviceID;
    }

    @JsonProperty("DeviceName")
    public String getDeviceName() {
        return DeviceName;
    }

    public void setDeviceName(String deviceName) {
        DeviceName = deviceName;
    }

    @JsonProperty("DeviceCode")
    public String getDeviceCode() {
        return DeviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        DeviceCode = deviceCode;
    }

    @JsonProperty("ConfigurationID")
    public int getConfigurationID() {
        return ConfigurationID;
    }

    public void setConfigurationID(int configurationID) {
        ConfigurationID = configurationID;
    }

    @JsonProperty("ConfigurationName")
    public String getConfigurationName() {
        return ConfigurationName;
    }

    public void setConfigurationName(String configurationName) {
        ConfigurationName = configurationName;
    }

    @JsonProperty("ConfigurationCode")
    public String getConfigurationCode() {
        return ConfigurationCode;
    }

    public void setConfigurationCode(String configurationCode) {
        ConfigurationCode = configurationCode;
    }

    @JsonProperty("Number")
    public double getNumber() {
        return Number;
    }

    public void setNumber(double number) {
        Number = number;
    }

    @JsonProperty("AssetInfoID")
    public int getAssetInfoID() {
        return AssetInfoID;
    }

    public void setAssetInfoID(int assetInfoID) {
        AssetInfoID = assetInfoID;
    }

    @JsonProperty("MaterialID")
    public int getMaterialID() {
        return MaterialID;
    }

    public void setMaterialID(int materialID) {
        MaterialID = materialID;
    }

    @JsonProperty("MaterialNo")
    public String getMaterialNo() {
        return MaterialNo;
    }

    public void setMaterialNo(String materialNo) {
        MaterialNo = materialNo;
    }

    @JsonProperty("MaterialName")
    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String materialName) {
        MaterialName = materialName;
    }
}
